from django.contrib import admin


class BaseModelAdmin(admin.ModelAdmin):
    def display_created_time(self, obj):
        return obj.create_time.strftime("%Y-%m-%d %H:%M:%S")

    display_created_time.short_description = "创建时间"

    def display_update_time(self, obj):
        return obj.update_time.strftime("%Y-%m-%d %H:%M:%S")

    display_update_time.short_description = "更新时间"
